package svgedit.gui.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import svgedit.gui.Frame;
import svgedit.gui.command.UnGroupCommand;

/** Finds selected group elements and moves their children into the root
 *  group, deleting the group elements.
 */
@SuppressWarnings("serial")
public class UngroupAction extends AbstractAction {

    private Frame frame;

    /** Create this action for the given frame */
    public UngroupAction(Frame frame) {
        super("Ungroup");
        this.frame = frame;
    }

    public void actionPerformed(ActionEvent ae) {
    	UnGroupCommand ungroupCommand = new UnGroupCommand(frame);
        frame.getView().getCommandStack().addCommand(ungroupCommand);
    }
}
